#ifndef UI_USERICONLABEL_H
#define UI_USERICONLABEL_H

#include <QLabel>
#include <QMenu>
#include "data/FanfouUser.h"
namespace Fanfou
{
	class FanfouContext;
	class UserIconLabelMenu : public QMenu
	{
		public:
			UserIconLabelMenu(FanfouContext* c):m_context(c){}
			FanfouContext* m_context;
	};

	class UserIconLabel : public QLabel
	{
		public:
			explicit UserIconLabel(QWidget* p = 0);
			void setAuthor(const FanfouUser& a) { m_author = a; }

			static void InitMenu(FanfouContext*);
			static void DestroyMenu();

		protected:
			void contextMenuEvent(QContextMenuEvent*);
		private:
			static QAction* M_MailAct;
			static QAction* M_ReplyAct;
			static QAction* M_ViewWebAct;
			static UserIconLabelMenu* M_Menu;

			FanfouUser m_author;
			friend class UserIconLabelMenu;
	};
}
#endif // USERICONLABEL_H
